﻿using System.Runtime.CompilerServices;

namespace TotalApplication.Core
{
    public interface ILogFactory
    {
        #region Events

        event Action<(string message, LogFactoryLevel level)> NewLog;

        #endregion

        #region Properties

        /// <summary>
        /// The level of logging to output
        /// </summary>
        LogFactoryLevel LogOutPutLevel { get; set; }

        bool IncludeLogOriginDetails { get; set; }

        #endregion

        #region Methods

        void AddLogger(ILogger logger);

        void RemoveLogger(ILogger logger);

        /// <summary>
        /// Logs the specific message to all loggers in this factory
        /// </summary>
        /// <param name="message">Message</param>
        /// <param name="level">Log Level</param>
        /// <param name="origin">The method/function this message was logged in</param>
        /// <param name="filePath">The code filename that this message wa logged from</param>
        /// <param name="LineNumber">The line of code in the filaname this message was logged from</param>
        void Log(string message, LogFactoryLevel level = LogFactoryLevel.Informative, [CallerMemberName]string origin = "", [CallerFilePath]string filePath = "", [CallerLineNumber]int LineNumber = 0);


        #endregion
    }
}
